package com.atguigu.controller;

import com.atguigu.pojo.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {

    @PostMapping
    public void save(@RequestBody User user) {
        System.out.println("user save ...");
    }

    @PutMapping
    public void update(@RequestBody User user) {
        System.out.println("user update ...");
    }

    @DeleteMapping("/{id}")
    public void delete(@PathVariable("id") Integer id) {
        System.out.println("user delete ...");
    }

    @GetMapping("/{id}")
    public User getById(@PathVariable("id") Integer id) {
        System.out.println("user getById ...");
        return null;
    }

    public List<User> pageQuery(@RequestParam(required = false,defaultValue = "1") int pageNo , int pageSize , @RequestParam(required = false)String name){
        return null;
    }
}

